﻿namespace ServerApp
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Runtime.Serialization;
    using Server;

    /// <summary>
    /// Class that displays orderView
    /// </summary>
    [DataContract]
    public class OrderView
    {
        #region INullable Members

        private bool m_Null = false;

        public bool IsNull
        {
            get { return m_Null; }
        }

        public static OrderView Null
        {
            get
            {
                return new OrderView(0)
                {
                    m_Null = true
                };
            }
        }

        #endregion

        /// <summary>
        /// Id of the order
        /// </summary>
        [DataMember]
        public long Id { get; private set; }

        /// <summary>
        /// Status of the order
        /// </summary>
        [DataMember]
        public OrderStatus Status { get; set; }

        /// <summary>
        /// Date and time of the order creation
        /// </summary>
        [DataMember]
        public DateTime CreatedDateTime { get; set; }

        /// <summary>
        /// Price of the order
        /// </summary>
        [DataMember]
        public long Price { get; set; }

        /// <summary>
        /// Customer who made the order
        /// </summary>
        [DataMember]
        public User Customer { get; set; }

        /// <summary>
        /// Executor of the order
        /// </summary>
        [DataMember]
        public User Executor { get; set; }

        public OrderView(long id)
        {
            this.Id = id;
        }
    }
}
